package com.gonsin.ta.example.nodes.nodeComponents;

import com.gonsin.base.exceptions.MyException;
import com.gonsin.ta.example.services.RealLogicService;
import com.gonsin.ta.logic.annotations.NodeComponent;
import com.gonsin.ta.logic.components.RunNode;
import com.gonsin.ta.logic.parse.condition.context.ChainContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
@NodeComponent(nodeId = "发送通知")
public class SendNews implements RunNode {

    /**
     * 注入自己的业务逻辑
     */
    @Autowired private RealLogicService logicService;

    @Override
    public void processRun(ChainContext context) {
        logicService.sampleMethod();
        log.info("发送通知");
//        throw new MyException(500, "测试抛出异常");
    }
}
